import { LoaderFunctionArgs } from 'react-router-dom'

export default async ({ params }: LoaderFunctionArgs) => {
  const content = await window.api.sql(`select * from contents where id=${params.id}`, 'findOne')
  const categories = await window.api.sql(`select * from categories`, 'findAll')
  return { content, categories }
}
